var t = require("./signin-util"), e = function(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}(require("../../../utils/config"));

Component({
    properties: {
        showCancel: {
            type: Boolean,
            value: !0
        }
    },
    data: {
        shown: !1,
        appName: e.default.appName
    },
    methods: {
        _signIn: function(e) {
            var n = this;
            (0, t.registerToken)(e).then(this._success.bind(this)).catch(function() {
                return n.show();
            });
        },
        _success: function() {
            wx.showToast({
                title: "登录成功",
                duration: 500
            }), this.hide();
        },
        _onClose: function() {
            this.setData({
                shown: !1
            });
        },
        show: function() {
            this.setData({
                shown: !0
            });
        },
        hide: function() {
            this._onClose();
        }
    }
});